package org.example.springoauth2.securitycommon.util;

/**
 * @author hzq
 * @date 2021/9/11 9:13
 */
public class TenantHolder {

    private static final ThreadLocal<Integer> THREAD_LOCAL = new InheritableThreadLocal<>();

    public static Integer get(){
        return THREAD_LOCAL.get();
    }

    public static void set(Integer tenantId){
        THREAD_LOCAL.set(tenantId);
    }

    public static void remove(){
        THREAD_LOCAL.remove();
    }
}
